package com.pz.gulimall.product;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
1、配置数据源 application-dev.yml
 2、开启 MapperScan 扫描dao
 */

@SpringBootApplication
@MapperScan("com.pz.gulimall.product.dao")
@EnableDiscoveryClient
@EnableFeignClients(basePackages = "com.pz.gulimall.product.feign")
@EnableCaching
@EnableScheduling  //开启定时任务
public class GuLiMallProductApplication {
    public static void main(String[] args) {
        SpringApplication.run(GuLiMallProductApplication.class,args);
    }

    @Bean
    public MessageConverter messageConverter(){
        return new Jackson2JsonMessageConverter();
    }
}
